let oldPage = Page
wx.waitLoginPages = []
Page = function(args){
  let onLoad = args.onLoad
  args.onLoad = function(options){
    if(wx.userInfo && wx.token){
      onLoad.call(this,options)
    }else{
        wx.waitLoginPages.push({
        context:this,
        onLoad,
        options
      })
    }
  }
  oldPage(args)
}